package it.gius.pe.shapes.witness;

public class TwoPointWitness implements Witness{
	
	public SinglePointWitness firstWitness;
	public SinglePointWitness secondWitness;
	
	@Override
	public Witness clone() {
		TwoPointWitness clone = new TwoPointWitness();
		clone.firstWitness = (SinglePointWitness)this.firstWitness.clone();
		clone.secondWitness = (SinglePointWitness)this.secondWitness.clone();
		
		return clone;
		
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((firstWitness == null) ? 0 : firstWitness.hashCode());
		result = prime * result
				+ ((secondWitness == null) ? 0 : secondWitness.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TwoPointWitness other = (TwoPointWitness) obj;
		if (firstWitness == null) {
			if (other.firstWitness != null)
				return false;
		} else if (!firstWitness.equals(other.firstWitness))
			return false;
		if (secondWitness == null) {
			if (other.secondWitness != null)
				return false;
		} else if (!secondWitness.equals(other.secondWitness))
			return false;
		return true;
	}
	
	
	

}
